// Init facebook sdk
window.fbAsyncInit = function() {
	FB.init({
	  appId      : 743808135658406, // REPLACE APP ID HERE
	  xfbml      : true,
	  version    : 'v2.0'
	});
};
(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.0";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));



jQuery(document).ready(function($) {
	$('.scrollpane').jScrollPane({showArrows: false,autoReinitialise: true,mouseWheelSpeed: 50,arrowButtonSpeed: 14,hijackInternalLinks: false});

	// 
	$("#twt_btn_x").click(function(){
	    $(".fb_twt_func .blk.twt_big .blkinner").animate({left:'-310px'});
	  });
	// $("#fb_btn_x").click(function(){
	//    	$(".fb_twt_func .blk.fb_big .blkinner").animate({left:'-310px'});
	// });

	// slide
	$('.slide').bxSlider();

	// close
	$('.close').click(function(event) {
		$(this).parent().parent().slideUp('slow');
	});

	$('#step1-terms').hide();
	$('.terms').click(function(event) {
		$('#step1-terms').show('slow');
	});

	$('.facebook-connect').click(function(event) {
		FB.getLoginStatus(function(response) {
		  if (response.status === 'connected') {
		    console.log('Logged in.');
		  }
		  else {
		    FB.login();
		  }
		});
	});
	
	$('.artcle_share .facebook-share').click(function(event) {
		$(this).removeClass('in-active');
		$(this).parent().find('.twitter-share').addClass('in-active');
		return false;
	});
	$('.artcle_share .twitter-share').click(function(event) {
		$(this).removeClass('in-active');
		$(this).parent().find('.facebook-share').addClass('in-active');
		return false;
	});
	$('.in-active').click(function(event) {
		event.preventDefault();
		return false;
	});
});